label: Use the correct size in snapshot()
authorTimm Bäder <mail@baedert.org>
Tue, 27 Jun 2017 15:12:00 +0000 (17:12 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 20 Jul 2017 01:27:15 +0000 (21:27 -0400)
gtk/gtklabel.c

index 6b8c1ff61a0940c084293101e53919d7dc42c08f..a7107511e3acd3e284ba8b86b189ff1610643f39 100644 (file)
@@ -3905,7 +3905,6 @@ gtk_label_snapshot (GtkWidget   *widget,
   GtkLabelSelectionInfo *info;
   GtkStyleContext *context;
   gint lx, ly;
-  GtkAllocation allocation;
   int width, height, x;
 
   label = GTK_LABEL (widget);
@@ -3916,10 +3915,8 @@ gtk_label_snapshot (GtkWidget   *widget,
 
   context = _gtk_widget_get_style_context (widget);
 
-  gtk_widget_get_allocation (widget, &allocation);
+  gtk_widget_get_content_size (widget, &width, &height);
   x = 0;
-  width = allocation.width;
-  height = allocation.height;
 
   if (priv->text && (*priv->text != '\0'))
     {